import sys
import os

input_file = open(sys.argv[1])

if os.path.exists(sys.argv[2]):
    os.remove(sys.argv[2])

output_file = open(sys.argv[2],"w")

buffer = ""

while True:
    letter = input_file.read(1)
    if not letter:
        # print("End of file")
        break
    if letter.isalpha():
        # print(letter)
        buffer = buffer + letter
    else:
        if buffer != "":
            output_file.write(buffer + "\n")
            buffer = ""